package cn.edu.wzu.openlearning.config;


import cn.edu.wzu.openlearning.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class LoginConfig implements WebMvcConfigurer {

    @Override   //拦截器配置
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor()) //拦截器注册对象
                .addPathPatterns("/word/**") //指定要拦截的请求
                .excludePathPatterns("/word/wordDict")
                .excludePathPatterns("/word/searchWord"); //排除请求

    }
}
